<?php if (!defined('THINK_PATH')) exit(); /*a:5:{s:35:"./template/layres/html/user_tg.html";i:1577469159;s:52:"D:\GitCode\LayZy\template\layres\html\user_base.html";i:1576323825;s:55:"D:\GitCode\LayZy\template\layres\html\index_header.html";i:1576486957;s:52:"D:\GitCode\LayZy\template\layres\html\user_menu.html";i:1576253896;s:55:"D:\GitCode\LayZy\template\layres\html\index_footer.html";i:1577955242;}*/ ?>
<!DOCTYPE html>
<html class="us">
<head>
  <meta charset="utf-8">
  <meat name="robots" content="index,nofollow" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
<title>在线投稿 - <?php echo $site_config['seo_title']; ?></title>
<meta name="keywords" content="<?php echo $site_config['seo_keyword']; ?>">
<meta name="description" content="<?php echo $site_config['seo_description']; ?>">

  <link rel="shortcut icon" href="/public/images/favicon.ico">
  <link rel="stylesheet" href="/public/plugins/layui/css/layui.css">
  <link rel="stylesheet" href="/public/css/font.css">
  <link rel="stylesheet" href="/template/layres/css/public.css">
  <link rel="stylesheet" href="/template/layres/css/user.css" type="text/css" />
  <script src="/public/js/jquery-3.3.1.min.js"></script>
  
<link rel="stylesheet" href="/public//plugins/wangEditor/css/wangEditor.min.css">
<style>
    .wangEditor-menu-container .menu-item a {
        padding: 12px 0;
    }

    .wangEditor-menu-container .menu-item {
        height: 37px;
        width: 37px;
    }

    .wangEditor-menu-container .menu-group {
        padding: 0;
    }

    .wangEditor-container {
        border: 1px solid #e6e6e6;
    }
</style>

</head>
<body class="u-<?php echo $action; ?>">
<header>
  <div class="header-important">
    <div class="container layui-clear">
      <a href="/" class="logo">
        <img src="/template/layres/images/logo.png"/>
      </a>
      <img src="/template/layres/images/yxcz.png" class="logo-right-decation"/>
      <form action="/search"  class="search">
        <input type="text" placeholder="快来搜一搜吧！" value="<?php echo $keyword; ?>" name="keyword"/>
        <input type="submit" class="layui-icon" value="&#xe615;"/>
      </form>
    </div>
  </div>
  <nav class="web-nav">
    <div class="container layui-clear">
      <ul class="nav-ul">
        <li <?php if($URI == ''||$URI == '/'): ?>class="hover"<?php endif; ?>>
          <a href="/" target="_self">网站首页</a>
        </li>
        <?php if(is_array($nav) || $nav instanceof \think\Collection || $nav instanceof \think\Paginator): $i = 0; $__LIST__ = $nav;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
        <li <?php if($URI == $vo['link']): ?>class="hover"<?php endif; ?>>
          <a href="<?php echo $vo['link']; ?>" target="<?php echo $vo['target']; ?>"><?php echo $vo['name']; ?></a>
        </li>
        <?php endforeach; endif; else: echo "" ;endif; ?>
        <span class="border-bottom" hidden></span>
      </ul>
      <div class="header-user">
        <?php if(\think\Session::get('userid') != ''): ?>
        <img class="ico" src="<?php echo \think\Session::get('avatar'); ?>" onerror="this.src='/template/layres/images/a3o.png'"/>
        <div class="show-data">
          <div class="show logined">
            <i></i>
            <span class="logined_text">欢迎回来，<?php echo \think\Session::get('nickname'); ?></span>
            <span class="logined_text share">
							<b class="hot"></b>
							您已投稿分享过<font><?php echo \think\Session::get('posted_num'); ?></font>次 ，
							共有<font><?php echo \think\Session::get('praise_num'); ?></font>位老铁为你点赞
						</span>
            <div class="logined_btn layui-clear">
              <a href="/user/index.html">个人中心</a>
              <a href="javaScript:exit();">退出</a>
            </div>
          </div>
        </div>
      </div>
      <?php else: ?>
      <img class="ico" src="/template/layres/images/a3o.png"/>
      <div class="show-data">
        <div class="show">
          <i></i>
          <span>登录后，享受更多优质服务哦</span>
          <button onclick="openLoginK();">登录</button>
        </div>
      </div>
      <?php endif; ?>

    </div>
  </nav>
</header>
<article class="content-true">
  <section class="container layui-clear">
    <div class="index-container layui-clear">
      <div class="index-container layui-clear">
        <div class="i-nav left">
          <ul>
    <li <?php if($action == 'index'||$action == 'changeInfo'): ?>class='hover'<?php endif; ?>> <a href="/user/index.html"> <i class="iconfont icon-ziyuan"></i> 我的信息 </a> </li>
<!--    <li <?php if($action == 'shop'): ?>class='hover'<?php endif; ?>> <a href="/user/shop.html"> <i class="iconfont icon-zuanshi" style="font-size: 27px;margin-right: 7px;margin-left: -4px;"></i> 交易记录 </a> </li>-->
    <li <?php if($action == 'tg'): ?>class='hover'<?php endif; ?>> <a href="/user/tg.html"> <i class="iconfont icon-tougao"></i> 在线投稿 </a> </li>
    <li <?php if($action == 'record'): ?>class='hover'<?php endif; ?>> <a href="/user/record.html"> <i class="iconfont icon-jilu"></i> 投稿记录 </a> </li>
    <li> <a href="<?php echo url('index/user/home',array('uuid'=>session('uuid')?:0)); ?>"> <i class="iconfont icon-zhuye"></i> 个人主页 </a> </li>
    <li <?php if($action == 'comment'): ?>class='hover'<?php endif; ?>> <a href="/user/comment.html"> <i class="iconfont icon-pinglun"></i> 我的评论 </a> </li>
    <li <?php if($action == 'safe'): ?>class='hover'<?php endif; ?>> <a href="/user/safe.html"> <i class="iconfont icon-anquan"></i> 安全绑定 </a> </li>
    <li <?php if($action == 'changepass'): ?>class='hover'<?php endif; ?>> <a href="/user/changepass.html"> <i class="iconfont icon-mima1"></i> 修改密码 </a> </li>
</ul>
        </div>
        <div class="i-content right">
          
<div class="title">
    在线投稿
    <a href="/about/tgrule.html" target="_blank">必看的投稿规则</a>
</div>
<form class="layui-form atuikeFormSkin1" id="list_form">
    <div class="layui-form-item">
        <label class="layui-form-label">投稿标题<font color="#FF0000"> *</font></label>
        <div class="layui-input-block">
            <input type="text"  name="title" placeholder="请填写标题" lay-verify="required"  lay-verify="title"  autocomplete="off"  class="layui-input"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">投稿内容<font color="#FF0000"> *</font></label>
        <div class="layui-input-block">
            <!--style给定宽度可以影响编辑器的最终宽度-->
            <textarea id="textarea" name="content" required="" lay-verify="required" placeholder="详细描述" class="layui-textarea fly-editor" style="height: 460px;"></textarea>
        </div>
    </div>
    <div class="inline-form layui-clear">
        <div class="layui-form-item">
            <label class="layui-form-label">投稿专区</label>
            <div class="layui-input-block">
                <select name="type_id"  lay-verify="required" title="选择分类">
                    <option value="">请选择分类</option>
                    <?php if(is_array($category) || $category instanceof \think\Collection || $category instanceof \think\Paginator): $i = 0; $__LIST__ = $category;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                    <option value="<?php echo $vo['id']; ?>"><?php echo $vo['name']; ?></option>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
        </div>
        <div class="layui-form-item" style="width: 230px;">
            <label  class="layui-form-label">投稿封面 <i class="layui-icon layui-icon-tips" id="notice1"></i></label>
            <div class="layui-input-block">
                <div class="coverBox" hidden >
                    <img src="/template/layres/images/default.png" alt="">
                </div>
                <button  type="button" class="layui-btn layui-btn-primary uploadImg">
                    <i class="layui-icon layui-icon-picture-fine"></i> 上传
                </button>
                <input type="hidden" name="cover_img">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">类　　型</label>
        <div class="layui-input-block">
            <input type="radio" name="type" value="text"    title="纯文章" lay-filter="typeradio" checked>
            <input type="radio" name="type" value="file"    title="有附件" lay-filter="typeradio">
        </div>
    </div>
    <div class="layui-form-item zips" hidden>
        <label class="layui-form-label">附件<font color="#FF0000"> *</font></label>
        <div class="layui-input-inline">
            <button class="layui-btn layui-btn-primary zipupload" type="button"  >
                <i  class="layui-icon layui-icon-upload-drag"></i> 上传附件
            </button>
        </div>
        <div class="layui-form-mid layui-word-aux beizupload">为减轻服务器压力，仅支持Zip/Rar/Mp4/Apk格式，大于<?php echo $site_config['upsize']; ?>M的附件请先上传到网盘，然后
            将下载地址贴到下方输入框中
        </div>
    </div>
    <div class="layui-form-item zips" hidden>
    <label class="layui-form-label"></label>
    <div class="layui-input-block">
        <input type="text" id="down_link1" name="down_link1" placeholder="可以直接写附件下载路径（或网盘下载地址）"   autocomplete="off"  class="layui-input"/>
    </div>
    </div>
    <!--div class="layui-form-item"><div class="layui-input-block"><font color="#ef0048">近期115资源网正在备案，目前服务器是国外线路，带有附件投稿的请先将资源上传到网盘再投稿</font></div></div-->


    <div class="layui-form-item jdt" hidden>
        <label class="layui-form-label"></label>
        <div class="layui-input-block">
            <div class="layui-progress">
                <div class="layui-progress-bar" lay-percent="0%"></div>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">投稿奖励</label>
        <div class="layui-input-block">
            <input type="checkbox"    name="is_need" placeholder="" lay-skin="switch" lay-filter="payopen">
        </div>
    </div>
    <div class="inline-form layui-clear pays" hidden>
        <div class="layui-form-item">
            <label class="layui-form-label">真实姓名</label>
            <div class="layui-input-block">
                <input type="text" name="alipay_name" class="layui-input" placeholder="真实姓名"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">支付宝账号</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="alipay_account" placeholder="支付宝账户">
            </div>
        </div>

    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn atuikeBtnSkin1" lay-submit lay-filter="submitAll"  >立即投稿</button>
        </div>
    </div>
</form>

        </div>
      </div>

    </div>
  </section>
</article>
<!--底部区域-->
<footer>
    <div class="layui-clear container">
        <div class="left">
            <img src="/template/layres/images/logo.png" width="200" height="72"/>
            <p>
                本站提供最新游戏辅助,电影抢先看,QQ软件等。努力打造为全国网络爱好者提供优质服务的平台，让我们的生活更加精彩！
                商务合作请联系站长<a href="http://wpa.qq.com/msgrd?v=3&uin=<?php echo $site_config['webmaster_qq']; ?>&site=qq&menu=yes" target="_blank" style="text-indent:0;color: #ffffff; border: 1px solid #20c4ab; display: inline-block; padding: 0px 19px; margin-left: 20px; font-size: 14px;  border-radius: 21px;">QQ <?php echo $site_config['webmaster_qq']; ?></a>
            </p>
            <ul class="layui-clear">
                <li><a href="/about/">关于我们</a></li>
                <li><a href="/about/ad.html">广告合作</a></li>
                <li><a href="/user/tg.html">在线投稿</a></li>
                <li><a href="/about/send.html">酷站收录</a></li>
                <li><a href="/about/idea.html">意见反馈</a></li>
                <li><?php echo $site_config['site_tongji']; ?></li>
                <li><a href="http://www.miitbeian.gov.cn/" target="_blank"> <?php echo $site_config['site_icp']; ?></a></li>
            </ul>
        </div>
        <div class="right">
            <img title="扫码访问手机版" alt="扫码访问手机版" src="/template/layres/images/web-code.png"/>
        </div>
    </div>
</footer>
<!--底部结束-->

<div id="loginBox">
    <div id="login" class="layui-clear"><a href="javaScript:void(0)" class="iconfont closeLogin"><i class="layui-icon layui-icon-close"></i></a>
        <div class="left"><img src="/template/layres/images/a8e.png"> <span>Welcome</span></div>
        <div class="right" id="loginmain"><h3 class="tilg">登录您的账号</h3>
            <form class="center layui-form">
                <div class="input"><i class="iconfont icon-zhanghao"></i>
                    <input type="text" placeholder="手机/邮箱/用户名" lay-verify="username"  name="username"/></div>
                <div class="input"><i class="iconfont icon-mima"></i>
                    <input type="password" placeholder="请输入您的密码"  lay-verify="password" name="password"/></div>
                <div class="input code" style="display: none"> <i class="iconfont icon-yanzhengma"></i>
                    <input type="text" placeholder="验证码" name="verify_code"  maxlength="4" />
                    <img src="<?php echo url('index/page/captcha'); ?>?'+Math.random();" title="点击可刷新验证码"
                         onclick="this.src='<?php echo url('index/page/captcha'); ?>?'+Math.random();" id="img_code"
                         style="margin-top:20px;width:144px;height:45px;cursor:pointer" /></div>
                <div class="loo layui-clear">
                    <?php if($site_config['qqlogin_status'] == 1): ?> <div class="ks"><a href="/user/qqlogin.html"><img src="/template/layres/images/qq.png"/></a></div><?php endif; ?>
                    <div class="zc"><a href="javaScript:void(0);" class="zczh">注册账号</a>
                        <a href="/user/forgetpass.html" target="_blank">找回密码</a></div>
                </div>
                <button lay-submit lay-filter="login">立即登录</button>
            </form>
        </div>
        <div class="right" id="regmain" style="display:none;"><h3 class="tilg">注册新的账号</h3>
            <form class="center  layui-form">
                <div class="input"><i class="iconfont icon-zhanghao"></i>
                    <input type="text" id="username" placeholder="请输入您的手机或邮箱" lay-verify="username" autocomplete="off" name="username"/>
                </div>
                <div class="input code"> <i class="iconfont icon-yanzhengma"></i>
                    <input type="text" placeholder="图形码" lay-verify="verify_code" id="captcha" name="captcha" maxlength="4" autocomplete="off" required class="layui-required" />
                    <img id="captchaPic" src="<?php echo url('index/page/captcha'); ?>?'+Math.random();" title="点击可刷新验证码" onclick="this.src='<?php echo url('index/page/captcha'); ?>?_='+Math.random()" class="imgcode" />
                </div>
                <div class="input code">
                    <i class="iconfont icon-yanzhengma"></i>
                    <input type="text" placeholder="验证码" lay-verify="verify_smscode" name="smscode" maxlength="6" autocomplete="off" required class="layui-required" />
                    <div   style="position: absolute; height: 42px; right: 0; top: 0; width: 110px;margin-top: 8px;">
                    <button type="button" class="layui-btn layui-btn-normal" id="sendRegCode">发送验证码
                        </button>
                    </div>
                </div>
                <div class="input"><i class="iconfont icon-mima"></i>
                    <input type="password" placeholder="请输入您的密码" lay-verify="password" autocomplete="off" name="password"/></div>

                <div class="loo layui-clear">
                    <?php if($site_config['qqlogin_status'] == 1): ?><div class="ks"><a href="/user/qqlogin.html"><img src="/template/layres/images/qq.png"/></a></div><?php endif; ?>
                    <div class="zc"><a href="javaScript:void(0);"  id="yjyl" class="yjyl">我已经有账号了？</a></div>
                </div>
                <button  lay-submit lay-filter="register">立即注册</button>
            </form>
        </div>
    </div>
</div>
<a class="backtop iconfont icon-xiangshang"></a>
<script src="/public/plugins/layui/layui.js"></script>
<script src="/template/layres/js/public.js"></script>



<script type="text/javascript" src="/public//plugins/wangEditor/js/wangEditor.js"></script>

<script type="text/javascript">
    var editor = new wangEditor('textarea');
    $.getJSON("<?php echo url('index/index/getemotion'); ?>", function(data) {
        editor.config.uploadImgUrl = '<?php echo url("index/upload/wangeditor_upimage"); ?>';
        editor.config.uploadImgFileName = 'FileName';
        var emotiondata;
        emotiondata = data;
        emotiondata = JSON.parse(emotiondata);
        editor.config.emotions = emotiondata;
        editor.config.pasteText = false;
        editor.create();
    });

    var _name = 'USER_TG_FORM_DATA_CACHE';
    var btnText = $(".atuikeBtnSkin1").html();
    layui.use(['form', 'layer', 'upload', 'element'], function () {
        var form = layui.form;
        var layer = layui.layer;
        var upload = layui.upload;
        var element = layui.element;
        form.verify({
            title:function (val,item) {
                if (val.length<2){
                    return "标题过于简短的教程不会被收录";
                }
            }
        });

        $("#notice1").mouseover(function() {
            layer.tips('如文章中有图片，可以不必传。系统会默认读取内容中第一张的图片为封面图', this, {
                tips: [1, "#000"],'time':3000
            });
        });
        //监听提交
        form.on('submit(submitAll)', function (data) {

            if($(".atuikeBtnSkin1").html()!=btnText){
                return false;
            }

            // var content = editor.getContent();
            var auto_pass = $("input[name=auto_pass]");
            // if (( data.field.type==='text' && editor.getContentTxt().length<10 )){
            //     layer.msg('文章过于简短,',{icon:5});
            //     return false;
            // }
            if (data.field.auto_pass &&auto_pass.data('exempt')<1){
                layer.msg('免审次数不足,请使用普通投稿方式!',{icon:5});
                return false;
            }
            // data.field.content= content;
            $(".atuikeBtnSkin1").html('<i class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop" style="color:#FFF;font-size:24px;"></i>');
            request({
                data:data.field ,
                success:function (result) {
                    var open_data ={
                        type: 0,
                        shadeClose: true,
                        skin: 'atuikeLayerSkin1',
                        content: result.msg
                    };

                    if(result.code===1){
                        auto_pass.data('exempt',result.exempt_num);
                        $("#exempt").text(result.exempt_num);
                        result.code===1&&( open_data.btn=['我知道了','取消']);
                        open_data.yes = function(){
                            location.reload();
                        };
                        form_reset(data);
                    }else{

                    }
                    layer.open(open_data);
                    $(".atuikeBtnSkin1").html(btnText);
                }
            });
            return false
        });

        //奖励开关
        form.on('switch(payopen)', function (data) {
            if (data.elem.checked) {
                $(".pays").slideDown();
            } else {
                $(".pays").slideUp(100);
            }
        });

        //纯文章和附件
        form.on('radio(typeradio)', function (data) {
            if (data.value === "file") {
                $(".zips").slideDown();
            } else {
                $(".zips").slideUp(100);
            }
        });

        //监听上传封面
        var uploadImg = $(".uploadImg");
        var uploadInst = upload.render({
            elem: uploadImg,
            auto: false,
            accept:'image',
            //acceptMime:'image/*',
            choose: function (obj) {
                uploadImg.html('<i class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"></i>');
                obj.preview(function(index, file, result){
                    $("input[name=cover_img]").val(encodeURIComponent(result));
                });
                setTimeout(function () {
                    uploadImg.css({'border-color':'#00ca5f','color':'#00ca5f'}).html("封面已选择");
                }, 1000);
            }
        });

        uploadImg.hover(function () {
            var box = $("div.coverBox");
            if (uploadImg.siblings("input[name=cover_img]").val().length>10){
                box.fadeIn(200);   box.find("img")[0].src=  decodeURIComponent(uploadImg.siblings("input[name=cover_img]").val());
            }
        },function () {
            $("div.coverBox").fadeOut(100)
        });

        //监听上传附件

        var pro = $(".jdt .layui-progress-bar");
        var fz = parseInt("200")*1024;
        var upload_element =  $(".zipupload");
        var softloadInst = upload.render({
            elem: upload_element,
            url: config.api.upload,
            auto: true,
            field:'file_name',
            size:fz,
            accept: 'file',
            acceptMime:'application/zip,application/rar,video/mp4,application/vnd.android.package-archive',
            exts: 'zip|rar|mp4|apk',
            progress: function (value) {	 //上传进度回调 value进度值
                var bfb = value + "%";
                pro.width(bfb );  upload_element.css('color','#00ca5f').html(bfb);
                if ( value >= 100) {
                    $(".jdt").fadeOut(500);
                }
            },
            choose: function () {
                $(".zipupload").html("上传中..");
                $(".jdt").slideDown(300);
            },
            done: function (result) {
                layer.msg(result.msg,{icon:result.code});
                if(result.code===1){
                    $('#down_link1').val(result.data.src);
                    upload_element.css({'border-color':'#00ca5f','color':'#00ca5f'}).html("<i class='layui-icon layui-icon-ok-circle'></i>上传成功");
                }else{
                    upload_element.css({'border-color':'#e73f49','color':'#e73f49'}).html("<i class='layui-icon layui-icon-face-surprised'></i>上传失败");
                }
                setTimeout(function () {
                    pro.width(0);
                },100)
            }
        });

        function form_reset(data) {

            var thisForm = $(data.elem).parents(".layui-form");
            thisForm.find(".layui-form-item").each(function (i,e) {
                $(e).find("input[type=text],input[type=hidden]").val("");
                $(e).find(".layui-form-onswitch").trigger("click");
                $(e).find(".uploadImg").css({'color':'#888','border-color':'#888'}).html('<i class="layui-icon layui-icon-picture-fine"></i>上传');
                $(e).find(".layui-form-radio").eq(0).trigger("click");
                $(e).find('.zipupload').css({'color':'#888','border-color':'#888'}).html('<i class="layui-icon layui-icon-upload-drag"></i>上传附件');
            });
            $("#myEditor").html("");
            layui.data(_name,null);
            form.render();
        }

    });


    /**
     * 设置缓存
     * */
    // setInterval(function () {
    //     var formData = $("#list_form").field();
    //     var cacheData = {};
    //     if (formData.title && editor.hasContents()){
    //         cacheData.title = formData.title;
    //         cacheData.content= editor.getContent();
    //         layui.data(_name, {key:_name, value:cacheData});
    //     }
    // },3000);

    /**
     * 恢复缓存
     */
    var cacheData = layui.data(_name)[_name];
    if (cacheData){
        $(".bj-content").append('<div class="contentTask">检测到您之前可能有编辑的文案，您可以选择<a class="hfContent" onclick="javaScript:restoreFormData();">恢复</a></div>');
    }
    function restoreFormData() {
        cacheData = layui.data(_name)[_name];
        $("#list_form").find("input[name=title]").val(cacheData.title);
        $("#myEditor").html(cacheData.content);
        $(".contentTask").remove();
    }
</script>

</body>
</html>